3.45 \(\int \sec ^2(c+d x) (a+a \sec (c+d x)) (A+B \sec (c+d x)) \, dx\)

Optimal. Leaf size=86 \[ \frac {a (3 A+2 B) \tan (c+d x)}{3 d}+\frac {a (A+B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a (A+B) \tan (c+d x) \sec (c+d x)}{2 d}+\frac {a B \tan (c+d x) \sec ^2(c+d x)}{3 d} \]

[Out]

1/2*a*(A+B)*arctanh(sin(d*x+c))/d+1/3*a*(3*A+2*B)*tan(d*x+c)/d+1/2*a*(A+B)*sec(d*x+c)*tan(d*x+c)/d+1/3*a*B*sec
(d*x+c)^2*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {3997, 3787, 3767, 8, 3768, 3770} \[ \frac {a (3 A+2 B) \tan (c+d x)}{3 d}+\frac {a (A+B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a (A+B) \tan (c+d x) \sec (c+d x)}{2 d}+\frac {a B \tan (c+d x) \sec ^2(c+d x)}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2*(a + a*Sec[c + d*x])*(A + B*Sec[c + d*x]),x]

[Out]

(a*(A + B)*ArcTanh[Sin[c + d*x]])/(2*d) + (a*(3*A + 2*B)*Tan[c + d*x])/(3*d) + (a*(A + B)*Sec[c + d*x]*Tan[c +
 d*x])/(2*d) + (a*B*Sec[c + d*x]^2*Tan[c + d*x])/(3*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3768

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Csc[c + d*x])^(n - 1))/(d*(n -
 1)), x] + Dist[(b^2*(n - 2))/(n - 1), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1
] && IntegerQ[2*n]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3787

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3997

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.
) + (A_)), x_Symbol] :> -Simp[(b*B*Cot[e + f*x]*(d*Csc[e + f*x])^n)/(f*(n + 1)), x] + Dist[1/(n + 1), Int[(d*C
sc[e + f*x])^n*Simp[A*a*(n + 1) + B*b*n + (A*b + B*a)*(n + 1)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f
, A, B}, x] && NeQ[A*b - a*B, 0] &&  !LeQ[n, -1]

Rubi steps

\begin {align*} \int \sec ^2(c+d x) (a+a \sec (c+d x)) (A+B \sec (c+d x)) \, dx &=\frac {a B \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {1}{3} \int \sec ^2(c+d x) (a (3 A+2 B)+3 a (A+B) \sec (c+d x)) \, dx\\ &=\frac {a B \sec ^2(c+d x) \tan (c+d x)}{3 d}+(a (A+B)) \int \sec ^3(c+d x) \, dx+\frac {1}{3} (a (3 A+2 B)) \int \sec ^2(c+d x) \, dx\\ &=\frac {a (A+B) \sec (c+d x) \tan (c+d x)}{2 d}+\frac {a B \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {1}{2} (a (A+B)) \int \sec (c+d x) \, dx-\frac {(a (3 A+2 B)) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac {a (A+B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a (3 A+2 B) \tan (c+d x)}{3 d}+\frac {a (A+B) \sec (c+d x) \tan (c+d x)}{2 d}+\frac {a B \sec ^2(c+d x) \tan (c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.34, size = 56, normalized size = 0.65 \[ \frac {a \left (3 (A+B) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (3 (A+B) \sec (c+d x)+6 (A+B)+2 B \tan ^2(c+d x)\right )\right )}{6 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2*(a + a*Sec[c + d*x])*(A + B*Sec[c + d*x]),x]

[Out]

(a*(3*(A + B)*ArcTanh[Sin[c + d*x]] + Tan[c + d*x]*(6*(A + B) + 3*(A + B)*Sec[c + d*x] + 2*B*Tan[c + d*x]^2)))
/(6*d)

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 105, normalized size = 1.22 \[ \frac {3 \, {\left (A + B\right )} a \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (A + B\right )} a \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, {\left (3 \, A + 2 \, B\right )} a \cos \left (d x + c\right )^{2} + 3 \, {\left (A + B\right )} a \cos \left (d x + c\right ) + 2 \, B a\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/12*(3*(A + B)*a*cos(d*x + c)^3*log(sin(d*x + c) + 1) - 3*(A + B)*a*cos(d*x + c)^3*log(-sin(d*x + c) + 1) + 2
*(2*(3*A + 2*B)*a*cos(d*x + c)^2 + 3*(A + B)*a*cos(d*x + c) + 2*B*a)*sin(d*x + c))/(d*cos(d*x + c)^3)

________________________________________________________________________________________

giac [A]  time = 0.99, size = 154, normalized size = 1.79 \[ \frac {3 \, {\left (A a + B a\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (A a + B a\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (3 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 9 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

1/6*(3*(A*a + B*a)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*(A*a + B*a)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(
3*A*a*tan(1/2*d*x + 1/2*c)^5 + 3*B*a*tan(1/2*d*x + 1/2*c)^5 - 12*A*a*tan(1/2*d*x + 1/2*c)^3 - 4*B*a*tan(1/2*d*
x + 1/2*c)^3 + 9*A*a*tan(1/2*d*x + 1/2*c) + 9*B*a*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^3)/d

________________________________________________________________________________________

maple [A]  time = 1.15, size = 128, normalized size = 1.49 \[ \frac {a A \tan \left (d x +c \right )}{d}+\frac {a B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {a A \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 a B \tan \left (d x +c \right )}{3 d}+\frac {a B \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x)

[Out]

a*A*tan(d*x+c)/d+1/2/d*a*B*sec(d*x+c)*tan(d*x+c)+1/2/d*a*B*ln(sec(d*x+c)+tan(d*x+c))+1/2*a*A*sec(d*x+c)*tan(d*
x+c)/d+1/2/d*a*A*ln(sec(d*x+c)+tan(d*x+c))+2/3/d*a*B*tan(d*x+c)+1/3/d*a*B*tan(d*x+c)*sec(d*x+c)^2

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 127, normalized size = 1.48 \[ \frac {4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a - 3 \, A a {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 3 \, B a {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, A a \tan \left (d x + c\right )}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/12*(4*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*a - 3*A*a*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)
+ 1) + log(sin(d*x + c) - 1)) - 3*B*a*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d
*x + c) - 1)) + 12*A*a*tan(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 3.99, size = 126, normalized size = 1.47 \[ \frac {a\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (A+B\right )}{d}-\frac {\left (A\,a+B\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-4\,A\,a-\frac {4\,B\,a}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (3\,A\,a+3\,B\,a\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B/cos(c + d*x))*(a + a/cos(c + d*x)))/cos(c + d*x)^2,x)

[Out]

(a*atanh(tan(c/2 + (d*x)/2))*(A + B))/d - (tan(c/2 + (d*x)/2)*(3*A*a + 3*B*a) + tan(c/2 + (d*x)/2)^5*(A*a + B*
a) - tan(c/2 + (d*x)/2)^3*(4*A*a + (4*B*a)/3))/(d*(3*tan(c/2 + (d*x)/2)^2 - 3*tan(c/2 + (d*x)/2)^4 + tan(c/2 +
 (d*x)/2)^6 - 1))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a \left (\int A \sec ^{2}{\left (c + d x \right )}\, dx + \int A \sec ^{3}{\left (c + d x \right )}\, dx + \int B \sec ^{3}{\left (c + d x \right )}\, dx + \int B \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)),x)

[Out]

a*(Integral(A*sec(c + d*x)**2, x) + Integral(A*sec(c + d*x)**3, x) + Integral(B*sec(c + d*x)**3, x) + Integral
(B*sec(c + d*x)**4, x))

________________________________________________________________________________________